# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgbase=diffstat
pkgname=diffstat
pkgver=1.62
pkgrel=1
pkgdesc="Display a histogram of diff changes"
arch=('i686' 'x86_64')
url="https://invisible-island.net/diffstat"
depends=('msys2-runtime')
groups=('base-devel')
license=('MIT')
source=("https://invisible-mirror.net/archives/${pkgbase}/${pkgbase}-${pkgver}.tgz"{,.asc}
        diffstat-1.62-msys2.patch)
sha256sums=('7f09183644ed77a156b15346bbad4e89c93543e140add9dab18747e30522591f'
            'SKIP'
            'b0dba10dfb4dd41fb0eacb1daf315bfa466889c9289682c04931d3887051d7fa')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 -i ${srcdir}/diffstat-1.62-msys2.patch
}

build () {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure --build=${CHOST} \
    --prefix=/usr \
    --mandir=/usr/share/man
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR=${pkgdir}/ install
  install -Dm644 package/debian/copyright "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
